import {
  /*  ApiPatientCardList */
} from '../../api/index'
const app = getApp()
let {
  baseUrl,
  commonUpdate,
  commonUpload
} = app.globalData
Page({
  data: {
    baseUrl,
    commonUpdate,
    commonUpload
  },
  onLoad() {
    /*    this.getPatientList() */

  },
  onShow() {
    this.getUserInfo()
    /*     this.getPatientList() */
    this.getTabBar().init();
  },
  //接诊设置
  receptionSetup() {
    wx.navigateTo({
      url: '/pagesDoctor/receptionSetup/index',
    })
  },

  //接诊价格设置
  admissionPriceSetting() {
    wx.navigateTo({
      url: '/pagesDoctor/admissionPrice/index',
    })
  },

  //自主排班设置
  autonomousSchedulingSetting() {
    wx.navigateTo({
      url: '/pagesDoctor/autonomousScheduling/index',
    })
  },


  //诊疗列表
  treatmentList() {
    wx.navigateTo({
      url: '/pagesDoctor/myOrderList/index',
    })
  },
  //我的评价
  myEval() {
    wx.navigateTo({
      url: '/pagesDoctor/myEvaluation/index',
    })
  },
  //我的收益
  myPayoff() {
    wx.navigateTo({
      url: '/pagesDoctor/myPayoff/index',
    })
  },

  //我的处方
  myPrescription() {
    wx.navigateTo({
      url: '/pagesDoctor/myPrescription/index',
    })
  },

  getPatientList() {
    wx.showLoading({
      title: '加载中'
    })
    ApiPatientCardList().then(res => {
      this.setData({
        patientList: res.data
      })
      wx.hideLoading()
    })
  },
  //编辑
  onEdit() {
    const item = this.data.userInfo
    wx.navigateTo({
      url: '/pagesDoctor/userEdite/index?item=' + JSON.stringify(item),
    })
  },

  openClick() {

  },

  //退出登录
  exitLogin() {
    wx.showModal({
      title: "是否确认退出本系统？",
      success(res) {
        if (res.confirm) {
          app?.ws?.close()
          wx.clearStorage()
          wx.reLaunch({
            url: "/pagesDoctor/doctorLogin/index",
          })
        }
      }
    })
  },

  async getUserInfo() {
    this.setData({
      userInfo: wx.getStorageSync('userInfo'),
    }, () => {

    })
  },


  //完善信息
  /*   improveInformation() {

    }
   */

})
//editPatient